{layout '../Public/layoutList.latte'} {*继承layoutList模板*}
{block title}{$title}{/block}
{block actions}
    {*<a href="{url('consoles_add','con=task&types=temp')}" class="icon-adds" data-side-form>发布普通任务</a>*}
    {*<a href="{url('consoles_add','con=task&types=cycle')}" class="icon-adds" data-side-form>发布周期任务</a>*}
{/block}
{block actionstab}
    {include "./actionstab.latte"}
{/block}
{block private_css}
    {include "./listCss.latte"}
{/block}
{block private_js}
    <script>
        init.ready(function () {
            if (typeof window.timerdeadlineList !== "undefined") {
                clearInterval(window.timerdeadlineList);
            }
            window.timerdeadlineList = setInterval(function () {
                $("[data-deadline]").each(function () {
                    var endTimes = $(this).attr("data-deadline");
                    var cTime = countDown(endTimes);
                    if (cTime == '0秒') {
                        var cTime = '已超时';
                    }
                    $(this).text(cTime);
                });
            }, 1000);
        });
    </script>
{/block}
{block content}
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
        <thead>
        <tr>
            <th data-sort="t.codeNo"><span class="table-head">任务编号</span></th>
            <th data-sort="t.priority"><span class="table-head">优先级</span></th> {*在th加入 data-sort 可对数据库进行排序*}
            <th data-sort="t.types"><span class="table-head">任务类型</span></th>
            <th data-sort="t.names"><span class="table-head">任务</span></th>
            <th data-sort="u.fullName"><span class="table-head">发布人</span></th>
            <th data-sort="t.executors"><span class="table-head">执行人</span></th>
            <th data-sort="u.fullName"><span class="table-head">验收人</span></th>
            <th data-sort="t.addTime"><span class="table-head">发布时间</span></th>
            <th data-sort="t.deadline"><span class="table-head">状态</span></th>
            <th><span class="table-head">操作</span></th>
        </tr>
        </thead>
        <tbody>
        {foreach $lists as $k=>$item}
            <tr>
                <td class="wid-auto">#{$item['t_codeNo']}</td>
                <td class="wid-auto">
                    <div class="garden Letter-{$item['priorityMemo']}">{$item['priorityMemo']}</div>
                </td>
                <td class="wid-auto">{$item['taskTypesMemo']}</td>
                <td class="wid-auto">
                    {if $item['groupName']}
                        <span style="padding:2px 5px; border:1px solid #aaa;">{$item['groupName']}</span>
                    {/if}
                    {$item['t_names']}
                </td>
                <td class="wid-auto">{$item['u_fullName']}</td>
                <td class="wid-auto">{$item['executorMemo']}</td>
                <td class="wid-auto">{$item['u2_fullName']}</td>
                <td class="wid-auto">{$item['t_addTime']|totime}</td>
                <td class="wid-auto"
                        {if $item["a_status"]==0}
                            style="color:#009AE2;"
                        {elseif $item["a_status"]==2}
                            style="color:#FF9800;"
                        {elseif $item["a_status"]==3}
                            style="color:#E51C23;"
                        {elseif $item["a_status"]==1}
                            style="color:#259B24;"
                        {/if}
                >
                    {$item['statusMemo']}
                    {if $item["t_status"]==0}
                        (
                        <span {if $item["t_status"]==0}data-deadline="{$item["t_deadline"]|totime}"{/if}></span>
                        )
                    {/if}
                </td>
                <td>
                    <a class="right-exchange" href="{url('consoles_task_details','id='.$item["t_id"])}">
                        详情
                    </a>
                </td>
            </tr>
        {/foreach}
        </tbody>
    </table>
{/block}




